SortedMap

interface SortedMap<K, out V> : Map<K, V> (source)

A map that maintains its entries sorted according to its implementation-defined key ordering.

Extends Map with neighbor queries (floor, ceiling, higher, lower) and extremum access (firstKey, lastKey) for finding adjacent keys.

Type Parameters

K

The type of keys maintained by this map.

V

The type of mapped values.

See also

Inheritors

Properties

Link copied to clipboard
abstract val entries: Set<Map.Entry<K, V>>
Link copied to clipboard
abstract val keys: Set<K>
Link copied to clipboard
expect abstract val size: Int
Link copied to clipboard
abstract val values: Collection<V>

Functions

Link copied to clipboard
abstract fun ceiling(key: K): K?

Returns the least key greater than or equal to the given key, or null if there is no such key.

Link copied to clipboard
abstract fun containsKey(key: K): Boolean
Link copied to clipboard
abstract fun containsValue(value: V): Boolean
Link copied to clipboard
abstract fun firstKey(): K?

Returns the least key in this map, or null if the map is empty.

Link copied to clipboard
abstract fun floor(key: K): K?

Returns the greatest key less than or equal to the given key, or null if there is no such key.

Link copied to clipboard
abstract operator fun get(key: K): V?
Link copied to clipboard
abstract fun higher(key: K): K?

Returns the least key strictly greater than the given key, or null if there is no such key.

Link copied to clipboard
expect abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract fun lastKey(): K?

Returns the greatest key in this map, or null if the map is empty.

Link copied to clipboard
abstract fun lower(key: K): K?

Returns the greatest key strictly less than the given key, or null if there is no such key.